<?php
namespace demo;
/**
*
*/
date_default_timezone_set('PRC');


// define('APP',dir(__FILE__));
interface Pay{
	public function setPara();
	public function doPay();
	public function notice();
}

interface Log{
	public function writeLog($file);
}

abstract class Template{
	abstract function display($file);
}

/**
*支付宝支付
*/
class Alipay extends Template implements Pay,Log
{
	protected $pri_name = '';
	static public $_aliurl='https://dopay.alipay.com/wap';
	const TARGET ='https://dopay.alipay.com/wap';
	private $moneyObj=null;

	function __construct(Money $moneyObj)
	{
		$this->moneyObj = $moneyObj;
		// echo "构造函数"."<br/>";
		# code...
	}

	final static public function index(){
		echo "index";
	}
	public function display($file){
		echo "显示支付结果";
	}
	public function setPara(){
		echo "设置支付参数";
	}
	public function doPay(){
		echo "挑起支付：".self::TARGET;
		// echo "发起支付";
	}
	public function notice(){
		echo "回调支付";
	}
	public function writeLog($file){
		echo "日志写入成功";
	}

	public function __destruct(){
		// echo __CLASS__;
	}


	private function priFang($a,$b,$c){
		return $a + $b + $c;
	}
	public function __call($name, $arg){
		echo $name."<br />";
		print_r($arg);
	}

	public function __set($name,$value){
		echo "属性".$name ."=" .$value;
	}

	public function __get($name){
		echo "属性名为：".$name;
	}

	public function __isset($name){
		echo $name;
	}

	public function  __toString(){
		return __CLASS__;
	}

	public function __clone(){
		echo "string";
	}

}


/**
* 微信支付
*/
class Wepay implements Pay
{

	function __construct()
	{
		# code...
	}
	public function setPara(){}
	public function doPay(){}
	public function notice(){}



}


function create_class(){
	return new class{
		public $name = 'class';
	};
}

// var_dump(get_class(create_class()));die;


if (create_class() === create_class()) {
	echo "same";
	# code...
}else{
	echo "different";
}





